package com.itstyle.seckill.common.config;

import com.itstyle.seckill.common.filter.CheckInDataFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * *
 *
 * @author yangxiaogen
 * @date 2022/3/21 23:21
 */
@Configuration
public class WebConfiguration {
    // Comparator
    @Bean
    // @Scope
    public FilterRegistrationBean checkInDataFilter() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();

        // 将 filter 注册进配置文件中
        registrationBean.setFilter(new CheckInDataFilter());
        // 添加拦截路径
        //registrationBean.addUrlPatterns("/*");

        return registrationBean;
    }
}
